package com.android.plc.ui.adapter;

import android.content.Context;
import android.content.res.Resources;
import android.database.Cursor;
import android.net.Uri;

import com.android.plc.R;
import com.android.plc.classholder.BasicItem.Type;
import com.android.plc.classholder.Room;
import com.android.plc.provider.PLC;
import com.android.plc.util.CursorUtil;

public class RoomAdapter extends EditorAdapter
{
	public String mEditString;
	public String mAllString;

	public RoomAdapter(Context context, Cursor cursor, int item_id, String[] from, int[] to, boolean edit)
	{
		super(context, cursor, item_id, from, to, edit);
		Resources resources = context.getResources();
		mAllString = resources.getString(R.string.all_room);
		mEditString = resources.getString(R.string.add);
	}

	@Override
	public Uri getUri()
	{
		return PLC.Rooms.CONTENT_URI;
	}

	@Override
	public String getEditString()
	{
		return mEditString;
	}

	@Override
	public String getAllString()
	{
		return mAllString;
	}

	@Override
	public Room getItem(Type type)
	{
		return new Room(type);
	}

	@Override
	public Room getItem(Cursor cursor, int index)
	{
		return CursorUtil.buildRoomFromCursor(cursor, index);
	}
}
